   
   <link href="{{$LAYOUT_HELPER_URL}}admin/js/jquery-ui/css/ui-lightness/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src="{{$LAYOUT_HELPER_URL}}admin/js/jquery-ui/js/jquery-ui.js"></script>
<script src="{{$LAYOUT_HELPER_URL}}admin/js/jquery.slug.js"></script>



    
<script type="text/javascript">
    //<![CDATA[
jQuery(document).ready(function (){
    //Datepicker
    jQuery( ".date" ).datepicker({
        showAnim        : 'slideDown',
        showOn: "button",
        buttonImage: "{{$LAYOUT_HELPER_URL}}admin/images/icons/calendar_icon.gif",
        showButtonPanel : true,
        dateFormat      : '{{$datepickerFormat.js}}'
    });
    
});

</script>
            
            
             <!-- End .shortcut-buttons-set -->
            
            <div class="clear"></div> <!-- End .clear -->
           
            
            
            <div class="content-box"><!-- Start Content Box -->
                
                <div class="content-box-header">
                    <div style="float:right;padding-right:20px;padding-top:5px;">
                        <form class="search" name="search" method="post" action="{{$APP_BASE_URL}}product/admin/search-product">
                            Từ ngày <input style="width: 100px;" class="text-input small-input date" type="text" name="condition[start]" id="borrow_date" value="{{if $condition.start != 0}}{{$condition.start}} {{/if}}"/>
                            Đến ngày <input style="width: 100px;" class="text-input small-input date" type="text" name="condition[end]" id="return_date" value="{{$condition.end}}"/>
                            
                            <input class="button" type="submit" value="Tìm" />
                        </form>
                        
                   </div>
                    <div style="float:left;">
                    <h3>Thống kê giao dịch</h3>
                   </div>     
                   <div style="float:right;padding-right:20px;padding-top:5px;">
                        
                   </div>
                    
                </div> <!-- End .content-box-header -->
                
                <div class="content-box-content">
                    
                    <div class="tab-content default-tab" id="tab1"> <!-- This is the target div. id must match the href of this div's tab -->
                        
                        
                        {{if $searchMessage|@count > 0 && $selectMessage.success == true}}
                        <div class="notification success png_bg">
                            <a href="#" class="close"><img src="{{$LAYOUT_HELPER_URL}}admin/images/icons/cross_grey_small.png" title="Close this notification" alt="close" /></a>
                            <div>
                                {{$searchMessage.message}}
                            </div>
                        </div>
                        {{/if}}
                        
                        {{if $searchMessage|@count > 0 && $searchMessage.success == false}}
                        <div class="notification error png_bg">
                            <a href="#" class="close"><img src="{{$LAYOUT_HELPER_URL}}admin/images/icons/cross_grey_small.png" title="Close this notification" alt="close" /></a>
                            <div>
                                {{$searchMessage.message}}
                            </div>
                        </div>
                        {{/if}}
                        
                        <!-- END MESSAGE -->
                        
                        
                        
                        <form method="POST" name="sortForm">
                       
                                </br>
                        
                        {{if $allInputs|@count > 0}}
                        <h3 style="color: blue;">Thông tin nhập hàng</h3>
                        </br>
                        <table>
                            <thead>
                                <tr>
                                   
                                   <th width="18%">Ngày nhập</th>
                                    <th width="20%">Tên sản phẩm</th>
                                     <th width="20%">Nhà sản xuất</th>
                                   <th width="15%">Giá nhập</th>
                                   <th width="15%">Số lượng</th>
                                </tr>
                                
                            </thead>
                         
                         
                            <tbody>
                            {{foreach from=$allInputs item=item name=product}}
                                <tr>
<!--                                    <td><input type="checkbox" value="{{$item.product_id}}" name="allProduct"/></td>-->
<!--                                    <td>{{$smarty.foreach.product.iteration}}</td>-->
                                    
                                    <td>{{$item.created_date}}</td>
                                    <td>{{$item.product_name}}</td>
                                    <td>{{$item.provider}}</td>
                                    <td>{{$item.input_price|number_format:0:",":" "}}</td>
                                    <td>{{$item.soluong|@number_format:0:'.':' '}}({{$item.unit}})</td>
                                    
                                    
                                    <!-- END 1 COL -->
                                    
                                </tr>
                            {{/foreach}}    
                            <tr style="color: red">
                                   
                                   <th width="22%"><b>Tổng Giá Trị Theo Giá Nhập:</b></th>
                                   <th width="15%"><b>{{$total}} VND</b></th>
                                   <th width="25%"><b>Tổng Giá Trị Theo Giá Bán (Tương Đối):</b></th>
                                    <th width="15%"><b>{{$totalGiaBan}} VND</b></th>
                                    <th width="1%"></th>
                                </tr>    
                            
                            </tbody>
                        </table>
                        {{/if}}
                        </br>
                        </br>
                        <br>
                        <br>
                        {{if $allSales|@count > 0}}
                        <h3 style="color: blue;">Thông tin bán hàng</h3>
                        </br>
                        <table>
                            <thead>
                                <tr>
                                   
                                   <th width="18%">Ngày bán</th>
                                   <th width="20%">Tên sản phẩm</th>
                                   <th width="20%">Nhà sản xuất</th>
                                   <th width="15%">Giá bán</th>
                                   <th width="15%">Số lượng</th>
                                </tr>
                                
                            </thead>
                         
                         
                            <tbody>
                            
                            {{foreach from=$allSales item=item name=product}}
                                <tr>
                                    
                                    <td>{{$item.created_date}}</td>
                                    <td>{{$item.product_name}}</td>
                                    <td>{{$item.provider}}</td>
                                    <td>{{$item.sale_price|number_format:0:",":" "}}</td>
                                    <td>{{$item.soluong|@number_format:0:'.':' '}}({{$item.unit}})</td>
                                    
                                    <!-- END 1 COL -->
                                    
                                </tr>
                            {{/foreach}}    
                                
                            <tr style="color: red">
                                   
                                   <th width="20%"><b>Tổng Giá Trị Theo Giá Nhập (Tương Đối):</b></th>
                                   <th width="15%"><b>{{$totalInSale}} VND</b></th>
                                   <th width="25%"><b>Tổng Giá Trị Theo Giá Bán:</b></th>
                                    <th width="15%"><b>{{$totalOuSale}} VND</b></th>
                                    <th width="1%"></th>
                                </tr>
                            </tbody>
                        </table>
                        {{/if}}
                        </form>
                        
                        <br/>
                        <div class="clear"></div>
                    </div> <!-- End #tab1 -->
                    
                    
                </div> <!-- End .content-box-content -->
                
            </div> <!-- End .content-box -->
            
            
            <div class="clear"></div>
            
<script language="javascript" type="text/javascript">


function deleteAInput(id)
{
    result = confirm('Are you sure you want to delete this input?');
    if (false == result) {
        return;
    }
    window.location.href = '{{$APP_BASE_URL}}product/admin/delete-input/id/' + id;
}

function deleteASale(id)
{
    result = confirm('Are you sure you want to delete this sale?');
    if (false == result) {
        return;
    }
    window.location.href = '{{$APP_BASE_URL}}product/admin/delete-sale/id/' + id;
}
</script>
